package com.woniu.product.controller;

import com.woniu.common.utils.ResponseData;
import com.woniu.product.pojo.ZyProductType;
import com.woniu.product.service.ZyProductService;
import com.woniu.product.service.ZyProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductTypeController {
    @Autowired
    private ZyProductTypeService productService;
    @GetMapping("/queryProductType")
    public ResponseData<?> queryProductType() {
        return productService.queryProductType();
    }

    @GetMapping("/queryProductTypeById")
    public ResponseData<?> queryProductTypeById(@RequestParam("id") Integer id) {
        return new ResponseData<ZyProductType>().success(productService.getById(id));
    }
}
